<template>
  <div class="reportFormPage">
    <div class="report-dom">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">
            <span>第</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.page }}&nbsp;</span>
            <span>页，共</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.totalPage }}&nbsp;</span>
            <span>页</span>
          </div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">钢筋焊接接头试验检测报告</div>
        <div class="codeText">BGLQ15005F</div>
      </div>
      <div class="threeTopBox">
        <div class="left-border">
          <div class="box-title">检测单位名称：</div>
          <div class>{{ form.jiancdwmc }}</div>
        </div>
        <div class="right-border">
          <span>报告编号：</span>
          <span v-if="isPdf" class="placeholder">{{ form.baogbh }}</span>
          <el-input class="code-input" v-else type="text" v-model="form.baogbh" @focus="handleFocus('baogbh')"/>
        </div>
      </div>
      <div class="table-border">
        <!------------------------------表头-------------------------->
        <table height="220px" class="top-table">
          <tbody>
          <tr>
            <td height="30" align="center" width="15%">
              <span style="width: 90px; display: inline-block">施工/委托单位</span>
            </td>
            <td width="35%" bgcolor="#ffffff">
              <span>{{ form.shigwtdw }}</span>
            </td>
            <td align="center" width="15%">
              <span style="width: 90px; display: inline-block">工程名称</span>
            </td>
            <td bgcolor="#ffffff" width="35%">
              <span>{{ form.gongcmc }}</span>
            </td>
          </tr>
          <tr>
            <td height="30" align="center" width="15%">
              <span style="width: 90px; display: inline-block">工程部位/用途</span>
            </td>
            <td colspan="3">
              <span>{{ form.gongcbwyt }}</span>
            </td>
          </tr>
          <tr>
            <td height="50" align="center">样品信息</td>
            <td class="specimen-border" colspan="3">
              <span>样品名称：</span>
              <span :class="{ 'placeholder':!form.yangpmc }">{{ form.yangpmc }}</span>
              <span>；样品编号：</span>
              <span :class="{ 'placeholder-long':!form.yangpbh }">{{ form.yangpbh }}</span>
              <span>；样品数量：</span>
              <span :class="{ 'placeholder':!form.yangpsl }">{{ form.yangpsl }}</span>
              <span>；样品状态：</span>
              <span :class="{ 'placeholder':!form.yangpzt }">{{ form.yangpzt }}</span>
              <span>；来样时间：</span>
              <span :class="{ 'placeholder':!form.yangpsj }">{{ form.yangpsj }}</span>
            </td>
          </tr>
          <tr>
            <td height="50" align="center" width="15%">
              <span style="width: 90px; display: inline-block">检测依据</span>
            </td>
            <td width="35%">
              <span v-if="isPdf">{{ form.jiancyj }}</span>
              <el-input v-else type="textarea" v-model="form.jiancyj" :rows="2" class="mark"
                        @dblclick.native="showBsJiancyjView" readonly/>
            </td>
            <td align="center" width="15%">
              <span style="width: 90px; display: inline-block">判定依据</span>
            </td>
            <td width="35%">
              <span v-if="isPdf">{{ form.pandyj }}</span>
              <el-input v-else type="textarea" v-model="form.pandyj" :rows="2" @dblclick.native="showBsJudgeBaseView"
                        @focus="handleFocus('pandyj')" class="mark"/>
            </td>
          </tr>
          <tr class="bottom-border">
            <td height="50" align="center">
              <div>主要仪器设备</div>
              <div>名称及编号</div>
            </td>
            <td colspan="3">
              <span v-if="isPdf">{{ form.zhuyyqsbmcjbh }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.zhuyyqsbmcjbh" class="height100 width100 mark"
                        @dblclick.native="showBsInstrumentView" readonly></el-input>
            </td>
          </tr>
          </tbody>
        </table>
        <!------------------------------表中-------------------------->
        <table height="616px" class="middle-table">
          <tbody>
          <tr height="25">
            <td>生产厂家</td>
            <td colspan="4">
              <el-input type="text" v-model="form.cd"/>
            </td>
            <td>代表数量</td>
            <td colspan="4">
              <el-input type="text" v-model="form.daibsl"/>
            </td>
          </tr>
          <tr height="25">
            <td>进场日期</td>
            <td colspan="4">
              <el-input type="text" v-model="form.jincrq"/>
            </td>
            <td>批号</td>
            <td colspan="4">
              <el-input type="text" v-model="form.pih"/>
            </td>
          </tr>
          <tr height="25">
            <td width="10%" rowspan="2">试件编号</td>
            <td width="10%" rowspan="2">焊接种类</td>
            <td width="10%" rowspan="2">钢筋牌号</td>
            <td width="10%" rowspan="2">直径(mm)</td>
            <td width="20%" colspan="2">极限强度(MPa)</td>
            <td width="10%" rowspan="2">断口型式</td>
            <td width="10%" rowspan="2">断口离焊口距离(mm)</td>
            <td width="10%" rowspan="2">弯曲结果</td>
            <td width="10%" rowspan="2">结果判定</td>
          </tr>
          <tr height="25">
            <td>技术指标</td>
            <td>检测结果</td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[0].shijbh" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[0].hanjzl" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[0].gangjph" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[0].zhij" disabled/>
            </td>
            <td rowspan="3">
              <!-- <el-input type="text" v-model="form.detailList[0].jiszb" /> -->
              <el-input type="text" v-model="form.detailList[0].jiszb" class="mark"
                        @dblclick.native="showBsJudgeBaseEditView(0, 1, 2)" readonly/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[0].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[0].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[0].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[0].wanqjg" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[0].jiegpd" disabled/>
            </td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[1].shijbh" disabled/>
            </td>
            <!-- <td><el-input type="text" v-model="form.detailList[1].jiszb" /></td> -->
            <td>
              <el-input type="text" v-model="form.detailList[1].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[1].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[1].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[1].wanqjg" disabled/>
            </td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[2].shijbh" disabled/>
            </td>
            <!-- <td><el-input type="text" v-model="form.detailList[2].jiszb" /></td> -->
            <td>
              <el-input type="text" v-model="form.detailList[2].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[2].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[2].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[2].wanqjg" disabled/>
            </td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[3].shijbh" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[3].hanjzl" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[3].gangjph" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[3].zhij" disabled/>
            </td>
            <td rowspan="3">
              <!-- <el-input type="text" v-model="form.detailList[3].jiszb" /> -->
              <el-input type="text" v-model="form.detailList[3].jiszb" class="mark"
                        @dblclick.native="showBsJudgeBaseEditView(3, 4, 5)" readonly/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[3].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[3].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[3].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[3].wanqjg" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[3].jiegpd" disabled/>
            </td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[4].shijbh" disabled/>
            </td>
            <!-- <td><el-input type="text" v-model="form.detailList[4].jiszb" /></td> -->
            <td>
              <el-input type="text" v-model="form.detailList[4].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[4].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[4].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[4].wanqjg" disabled/>
            </td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[5].shijbh" disabled/>
            </td>
            <!-- <td><el-input type="text" v-model="form.detailList[5].jiszb" /></td> -->
            <td>
              <el-input type="text" v-model="form.detailList[5].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[5].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[5].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[5].wanqjg" disabled/>
            </td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[6].shijbh" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[6].hanjzl" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[6].gangjph" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[6].zhij" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[6].jiszb" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[6].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[6].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[6].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[6].wanqjg" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[6].jiegpd" disabled/>
            </td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[7].shijbh" disabled/>
            </td>
            <!-- <td><el-input type="text" v-model="form.detailList[7].jiszb" /></td> -->
            <td>
              <el-input type="text" v-model="form.detailList[7].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[7].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[7].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[7].wanqjg" disabled/>
            </td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[8].shijbh" disabled/>
            </td>
            <!-- <td><el-input type="text" v-model="form.detailList[8].jiszb" /></td> -->
            <td>
              <el-input type="text" v-model="form.detailList[8].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[8].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[8].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[8].wanqjg" disabled/>
            </td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[9].shijbh" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[9].hanjzl" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[9].gangjph" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[9].zhij" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[9].jiszb" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[9].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[9].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[9].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[9].wanqjg" disabled/>
            </td>
            <td rowspan="3">
              <el-input type="text" v-model="form.detailList[9].jiegpd" disabled/>
            </td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[10].shijbh" disabled/>
            </td>
            <!-- <td><el-input type="text" v-model="form.detailList[10].jiszb" /></td> -->
            <td>
              <el-input type="text" v-model="form.detailList[10].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[10].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[10].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[10].wanqjg" disabled/>
            </td>
          </tr>
          <tr height="25">
            <td>
              <el-input type="text" v-model="form.detailList[11].shijbh" disabled/>
            </td>
            <!-- <td><el-input type="text" v-model="form.detailList[11].jiszb" disabled/></td> -->
            <td>
              <el-input type="text" v-model="form.detailList[11].jiancjg" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[11].dankxs" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[11].duanklhkjl" disabled/>
            </td>
            <td>
              <el-input type="text" v-model="form.detailList[11].wanqjg" disabled/>
            </td>
          </tr>
          <tr>
            <td colspan="10" height="60px">
              <span v-if="isPdf" class="textarea-span">{{ form.jiancjl }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.jiancjl" @focus="handleFocus('jiancjl')"
                        @dblclick.native="getJcjl()"/>
            </td>
          </tr>
          </tbody>
        </table>
        <!------------------------------附加声明-------------------------->
        <table height="60px" class="bottom-table">
          <tr>
            <td>
              <span v-if="isPdf" class="textarea-span">{{ form.fujsm }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.fujsm" @focus="handleFocus('fujsm')"/>
            </td>
          </tr>
        </table>
      </div>
      <!------------------------------表底-------------------------->
      <table height="22px" class="transparent">
        <tbody>
        <tr>
          <td width="10%" align="right">检测：</td>
          <td width="15%" align="left"></td>
          <td width="10%" align="right">审核：</td>
          <td width="15%" align="left"></td>
          <td width="10%" align="right">批准：</td>
          <td align="left" width="15%"></td>
          <td width="10%">日期：</td>
          <td align="left" width="15%"></td>
        </tr>
        </tbody>
      </table>
    </div>
    <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
    <bs-jiancyj-view ref="bsJiancyjViewRef" @select="selectJiancyj" :syType="syType"></bs-jiancyj-view>
    <bs-judge-base-view ref="bsJudgeBaseViewRef" @select="selectJudge" :syType="syType"></bs-judge-base-view>
    <bs-judge-base-edit-view ref="bsJudgeBaseEditViewRef" @submit="selectJudgeBaseEdit"
                             :syType="syType"></bs-judge-base-edit-view>
  </div>
</template>

<script>
import {
  listGjhjjtbgBsInfo,
  getGjhjjtbgBsInfo,
  delGjhjjtbgBsInfo,
  addGjhjjtbgBsInfo,
  updateGjhjjtbgBsInfo,
  queryJcjl
} from "@/api/report_gc/gjhjjtbgBsInfo";
import BsInstrumentView from "@/views/dept/bsInstrument/BsInstrumentView.vue";
import decimal from "@/utils/big-decimal";
import BsJiancyjView from "@/views/sycs/bsJiancyj/BsJiancyjView";
import BsJudgeBaseView from "@/views/sycs/bsJudgeBase/BsJudgeBaseView";
import Bus from "@/utils/bus";
import {emptyConvert, handleFocus, uniqueStr} from "@/views/reportForms/utils";
import {computeBiQualification} from "@/api/sycs/biQualification";
import BsJudgeBaseEditView from "@/views/sycs/bsJudgeBase/BsJudgeBaseEditView.vue";

export default {
  name: "gjhjjtbg",
  components: {
    BsInstrumentView,
    BsJiancyjView,
    BsJudgeBaseView,
    BsJudgeBaseEditView
  },
  props: {
    excelId: {
      type: [String, Number],
      default: () => ""
    },
    syType: {
      type: [String, Number],
      default: () => ""
    },
    page: {
      type: Number,
      default: () => 0
    },
    isPdf: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      activeKey1: null,
      activeKey2: null,
      activeKey3: null,
      id2: null,
      id3: null,
      params: {},
      query: {},
      // 表单参数
      form: {
        detailList: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]
      },
      // 表单校验
      rules: {
        excelId: [{required: true, message: "主键不能为空", trigger: "blur"}]
      }
    };
  },
  watch: {
    isPdf(newVal, oldVal) {
      this.form = {...emptyConvert(this.form, newVal)};
    }
  },
  created() {
    this.getInfo();
  },
  mounted() {
    Bus.$on("setGcHjjtForm", (data) => {
      this.form.detailList[0].hanjzl = data.detailList[0].hanjzl; //焊接种类
      this.form.detailList[0].gangjph = data.detailList[0].gangjph; //钢筋牌号
      this.form.detailList[0].zhij = data.detailList[0].zhij; //钢筋牌号
      this.form.detailList[3].hanjzl = data.detailList[3].hanjzl; //焊接种类
      this.form.detailList[3].gangjph = data.detailList[3].gangjph; //钢筋牌号
      this.form.detailList[3].zhij = data.detailList[3].zhij; //钢筋牌号
      for (let i = 0; i <= 5; i++) {
        this.form.detailList[i].shijbh = data.detailList[i].shijbh; //试件编号
        this.form.detailList[i].jiancjg = data.detailList[i].jixqd; //极限强度
        this.form.detailList[i].duanklhkjl = data.detailList[i].duanklhkjl; //断口离焊口距离
        this.form.detailList[i].dankxs = data.detailList[i].duankxs; //断口型式
        this.form.detailList[i].wanqjg = data.detailList[i].shiyjg; //弯曲结果
      }
    }),
      // 检测依据
      Bus.$on("setGjhjjtBgJiancyj", (data) => {
        const {jiancyj, jiancyjIds} = data;
        const str = jiancyj + (this.form.jiancyj ? "、" + this.form.jiancyj : "");
        const ids = jiancyjIds + (this.form.jiancyjIds ? "," + this.form.jiancyjIds : "");
        this.form.jiancyj = uniqueStr(str, "、");
        this.form.jiancyjIds = uniqueStr(ids, ",");
      });
    // 主要设备
    Bus.$on("setGjhjjtBgZhuyyqsbmcjbh", (data) => {
      const {zhuyyqsbmcjbh, shebIds} = data;
      const str = zhuyyqsbmcjbh + (this.form.zhuyyqsbmcjbh ? "、" + this.form.zhuyyqsbmcjbh : "");
      const ids = shebIds + (this.form.shebIds ? "," + this.form.shebIds : "");
      this.form.zhuyyqsbmcjbh = uniqueStr(str, "、");
      this.form.shebIds = uniqueStr(ids, ",");
    });
  },
  beforeDestroy() {
    // 或者你可以使用其他合适的生命周期钩子
    // 停止监听事件
    Bus.$off("setGcHjjtForm");
    Bus.$off("setGjhjjtBgJiancyj");
    Bus.$off("setGjhjjtBgZhuyyqsbmcjbh");
  },
  methods: {
    // 获取详情
    getInfo() {
      if (!this.excelId) {
        return;
      }
      getGjhjjtbgBsInfo(this.excelId || this.$defaultExcelId).then((response) => {
        this.form = response.data;
        if (!this.form.jiancjl) {
          this.form.jiancjl = "检测结论：";
        }
        if (!this.form.fujsm) {
          this.form.fujsm = "附加声明：";
        }
      });
    },

    // 显示检测依据列表
    showBsJiancyjView() {
      this.$refs.bsJiancyjViewRef.init(this.form.jiancyjIds);
    },
    // 检测依据选择
    selectJiancyj(info) {
      this.form.jiancyj = info.label;
      this.form.jiancyjIds = info.ids;
    },

    // 显示判定依据列表
    showBsJudgeBaseView() {
      this.$refs.bsJudgeBaseViewRef.init(this.form.pandyjIds);
    },
    // 判断依据选择
    selectJudge(info) {
      this.form.pandyjIds = info.ids;
      this.form.pandyj = info.label;
    },

    // 显示仪器列表
    showBsInstrumentView() {
      this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
    },
    // 仪器选择
    selectInstrument(info) {
      this.form.zhuyyqsbmcjbh = info.label;
      this.form.shebIds = info.ids;
    },

    // 获取检测结论
    getJcjl() {
      const form = JSON.parse(JSON.stringify(this.form));
      queryJcjl(emptyConvert(form)).then((res) => {
        const info = res.data;
        this.form.jiancjl = info.jiancjl;
      });
    },
    handleFocus(event) {
      handleFocus(event, this.page, this.form[event]);
    },
    // 显示单个技术编辑
    showBsJudgeBaseEditView(key1, key2, key3) {
      this.activeKey1 = key1;
      this.activeKey2 = key2;
      this.activeKey3 = key3;
      const info1 = this.form.baDetailVos[key1];
      const info2 = this.form.baDetailVos[key2];
      const info3 = this.form.baDetailVos[key3];

      this.id2 = this.form.baDetailVos[key2].id;
      this.id3 = this.form.baDetailVos[key3].id;
      info1.refQualId = info1.qualId;
      info2.refQualId = info2.qualId;
      info3.refQualId = info3.qualId;
      this.$refs.bsJudgeBaseEditViewRef.init(info1);
    },
    // 编辑单个技术指标后赋值
    selectJudgeBaseEdit(info) {
      if (info.qualId) {
        this.form.baDetailVos[this.activeKey1] = {...info, rowIndex: this.activeKey1};
        this.form.baDetailVos[this.activeKey2] = {...info, id: this.id2};
        this.form.baDetailVos[this.activeKey3] = {...info, id: this.id3};
      }
      this.computeDetectionResult([this.activeKey1, this.activeKey2, this.activeKey3]);
    },
    // 计算检测结果
    computeDetectionResult(keys) {
      if (!keys || keys.length <= 0) {
        return;
      }
      const data = keys.map((key) => {
        const info = {
          ...this.form.baDetailVos[key],
          jiancjg: this.form.baDetailVos[key].jiancjg == "-" ? "" : this.form.detailList[key].jiancjg
        };
        return info;
      });
      computeBiQualification(data).then((res) => {
        const returnData = res.data;
        let result = returnData.some((e) => e.jiegpd === "不符合");
        if (result) {
          returnData.forEach((item) => {
            this.form.detailList[this.activeKey1].jiszb = item.jiszb;
            this.form.detailList[this.activeKey1].jiegpd = "不符合";
          });
        } else {
          // 不存在不符合
          returnData.forEach((item) => {
            item.jiancjg = item.jiancjg ? item.jiancjg : "-";
            this.form.detailList[this.activeKey1].jiszb = item.jiszb;
            this.form.detailList[this.activeKey1].jiegpd = item.jiegpd == "-" ? "-" : item.jiegpd;
          });
        }
      });
    },
    submitForm() {
      return this.form;
    },
  }
};
</script>


<style scoped>
</style>
